package com.th.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 企业认证状态
 * @Author tuhang
 * @PackageName nswcy-crowdsource-back
 * @Package com.th.common.enums
 * @Date 2022/10/3 16:21
 * @Version 1.0
 */
@AllArgsConstructor
@Getter
public enum EnterpriseAuthStatus {

    NOT_SUBMIT(0,"未提交"),
    BE_AWAITING_APPROVAL(1,"待审批"),
    HAS_REFUSED(2,"已拒绝"),
    HAS_PASS(3,"已通过"),
    ;
    private Integer code;
    private String desc;

    /**
     * 检索企业认证状态
     * @param code
     * @return
     */
    public static  EnterpriseAuthStatus of(Integer code){
        return Arrays.stream(values()).filter(item -> item.code.equals(code)).findFirst().orElse(null);
    }
}
